Ҫ]סť϶ӰƬӰƬϹҲԹ
[]
һ½ӰƬΪ_mcֻͼƬ
½ӰƬΪmask_mcһΣ280300
½ťԪΪ_btnһΣ20300
ġ½ͼԪΪbtnbj_mcһΣ20300
塢صһ롰_mcʵΪ_mcڶ롰mask_mcʵΪmask_mc롰btnbj_mcĲ롰_btnʵΪ_btnд¶
<css.shtml' target='_blank' title = 'divƵ̳'>div class=HtmlCode>// 
_mc.setMask(mask_mc); 
//ӰƬťͰťӰƬĿɼ 
var ypgdjl:Number = _mc._height-mask_mc._height; 
if (ypgdjl<=0) { 
_btn._visible = 0; 
} else { 
_btn._visible = 1; 
} 
//ðťĸ߶Ⱥ 
_btn._height = int(mask_mc._height*mask_mc._height/_mc._height); 
_btn._x = mask_mc._width; 
_btn._y = mask_mc._y; 
//ť¿ʼ϶ӰƬ 
var btntdjl:Number = mask_mc._height-_btn._height; 
_btn.onPress = function() { 
delete _mc.onEnterFrame; 
startDrag(this, false, mask_mc._width, mask_mc._y, mask_mc._width, btntdjl); 
_mc.onEnterFrame = function() { 
this._y = -(int(_btn._y/btntdjl*ypgdjl)); 
}; 
}; 
_btn.onRelease = _btn.onReleaseOutside=function () { 
stopDrag(); 
delete _mc.onEnterFrame; 
}; 
//ֲӰƬť 
_mc.onRollOver = function() { 
mouseListener = new Object(); 
mouseListener.onMouseWheel = function(delta:Number) { 
delete _mc.onEnterFrame; 
_mc._y += delta*8; 
_mc.onEnterFrame = function() { 
_btn._y = -(int(_mc._y*btntdjl/ypgdjl)); 
if (this._y>=0) { 
this._y = 0; 
_btn._y = 0; 
delete this.onEnterFrame; 
} 
if (this._y<=-ypgdjl) { 
this._y = -ypgdjl; 
_btn._y = mask_mc._height-_btn._height; 
delete this.onEnterFrame; 
} 
}; 
}; 
Mouse.addListener(mouseListener); 
}; 
_mc.onRollOut = function() { 
Mouse.removeListener(mouseListener); 
};
www.21shipin.com  21Ƶ̳ 
򵥵Ĺ_Flash̳ ԭӣhttp://www.21shipin.com/html/43622.shtml